package com.dayatang.hrm.compensation.infra.hibernate;

import java.util.List;

import org.apache.tapestry5.hibernate.HibernateSessionManager;

import com.dayatang.commons.repository.EntityRepositoryHibernateTapestry;
import com.dayatang.hrm.compensation.domain.SalaryAccountSuite;
import com.dayatang.hrm.compensation.domain.SalaryItemType;
import com.dayatang.hrm.compensation.domain.SalaryItemTypeRepository;

@SuppressWarnings("unchecked")
public class SalaryItemTypeRepositoryImpl extends
		EntityRepositoryHibernateTapestry<SalaryItemType, Long> implements
		SalaryItemTypeRepository {

	public SalaryItemTypeRepositoryImpl(HibernateSessionManager sessionManager) {
		super(SalaryItemType.class, sessionManager);
	}
	
	@Override
	public List<SalaryItemType> findBySalaryAccountSuite(
			SalaryAccountSuite accountSuite) {
		return getSessionManager().getSession().getNamedQuery(
				"SalaryItemType.findBySalaryAccountSuite").setEntity("pSuite",
				accountSuite).list();
	}

}
